<%@page import="org.jeecgframework.web.util.StaticValue" %>
<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@include file="/context/mytags.jsp" %>
<!DOCTYPE html>
<html>
<head>
    <title>影院</title>
    <t:base type="jquery,easyui,tools,DatePicker"></t:base>
    <script type="text/javascript" src="plug-in/ckfinder/ckfinder.js"></script>
</head>
<body>
<div class="subtitle">
    <p>影院信息</p>
    <table class="nobordertable noborder">
        <tr>
            <td align="right" style="width: 100px;text-align: right">
                <label>影院中文名称:</label>
            </td>
            <td class="value" style="width: 300px;">
                <span>${zyCinemaPage.name}</span>
            </td>
            <td align="right" style="width: 100px;text-align: right">
                <label>影院英文名称:</label>
            </td>
            <td class="value" style="width: 300px;">
                <span>${zyCinemaPage.ename}</span>
            </td>
        </tr>
        <tr>
            <td align="right" style="text-align: right">
                <label>影院推广名称:</label>
            </td>
            <td class="value">
                <span>${zyCinemaPage.spreadName}</span>
            </td>
            <td align="right" style="text-align: right">
                <label>所属机构:</label>
            </td>
            <td class="value" id="org">
                <span>${zyCinemaPage.belongOrg.departname}</span>
            </td>
        </tr>
        <tr>
            <td align="right" style="text-align: right">
                <label>所属省市:</label>
            </td>
            <td class="value">
                <span>${zyCinemaPage.province.territoryName}</span>
            </td>
            <td align="right" style="text-align: right">
                <label>地址:</label>
            </td>
            <td class="value">
                <span>${zyCinemaPage.address}</span>
            </td>
        </tr>
        <tr>
            <td align="right" style="text-align: right">
                <label>电话:</label>
            </td>
            <td class="value">
                <span>${zyCinemaPage.phone}</span>
            </td>
            <td align="right" style="text-align: right">
                <label>传真:</label>
            </td>
            <td class="value">
                <span>${zyCinemaPage.fax}</span>
            </td>
        </tr>
        <tr>
            <td align="right" style="text-align: right">
                <label>影院编码:</label>
            </td>
            <td class="value">
                <span>${zyCinemaPage.code}</span>
            </td>
            <td align="right" style="text-align: right">
                <label>是否异常:</label>
            </td>
            <td class="value">
                <t:dictSelect field="isNormal" defaultVal='${zyCinemaPage.isNormal}' type="select"
                              typeGroupCode="<%=StaticValue.DIC_TRUE_OR_FALSE_NUM %>"/>
            </td>
        </tr>
        <tr>
            <td align="right" style="text-align: right">
                <label>异常原因:</label>
            </td>
            <td class="value">
                <span>${zyCinemaPage.exceptionReason}</span>
            </td>
            <td align="right" style="text-align: right">
                <label>服务状态:</label>
            </td>
            <td class="value">
                <t:dictSelect field="isService" defaultVal='${zyCinemaPage.isService}' type="select"
                              typeGroupCode="<%=StaticValue.DIC_CINEMA_SERVICE %>"/>
            </td>
        </tr>
        <tr>
            <td align="right" style="text-align: right">
                <label>是否有TMS:</label>
            </td>
            <td class="value">
                <t:dictSelect field="isTms" defaultVal='${zyCinemaPage.isTms}' type="select"
                              typeGroupCode="<%=StaticValue.DIC_TRUE_OR_FALSE_NUM %>"/>
            </td>
            <td align="right" style="text-align: right">
                <label>是否有NOC:</label>
            </td>
            <td class="value">
                <t:dictSelect field="isNoc" defaultVal='${zyCinemaPage.isNoc}' type="select"
                              typeGroupCode="<%=StaticValue.DIC_TRUE_OR_FALSE_NUM %>"/>
            </td>
        </tr>
        <tr>
            <td align="right" style="text-align: right">
                <label>经纬度:</label>
            </td>
            <td class="value">
                <span>${zyCinemaPage.latitude}</span>
            </td>
            <td align="right" style="text-align: right">
                <label>经营方式:</label>
            </td>
            <td class="value">
                <t:dictSelect field="business" type="select" defaultVal='${zyCinemaPage.business}'
                              typeGroupCode="<%=StaticValue.DIC_BUSINESS_WAY %>"/>
            </td>
        </tr>
        <tr>
            <td align="right" style="text-align: right">
                <label>影院整改函:</label>
            </td>
            <td class="value">
                <c:if test="${not empty list}">
                    <c:forEach var="name" items="${list}"><a class="color-blue" href="fileUploadController.do?downLoadFile&fileLogId=${name.id}">${name.name}</a>&nbsp;&nbsp;&nbsp;&nbsp;</c:forEach>
                </c:if>
            </td>
            <td align="right" style="text-align: right">

            </td>
            <td class="value">

            </td>
        </tr>
    </table>
</div>
<div class="subtitle">
    <p>影院联系人</p>
</div>
<div class="datagridDiv" style="height: 200px;overflow-x: scroll;">
    <t:datagrid name="zyContactsList" fitColumns="false"
                actionUrl="zyContactsController.do?datagrid&belongCinemaId=${zyCinemaPage.id }" idField="id" fit="true"
                pagination="false" onLoadSuccess="zyContactsListLoadSuccess">
        <t:dgCol title="主键" field="id" hidden="true" queryMode="single" width="120"/>
        <t:dgCol title="系统用户" field="tsBaseUser.realName" width="120" hidden="true" />
        <t:dgCol title="联系人类型" field="type" width="120" dictionary="<%=StaticValue.DIC_CONTACT_TYPE %>"/>
        <t:dgCol title="所属机构" field="belongOrg.shortname" width="120" hidden="true" />
        <t:dgCol title="名字" field="name" width="120"/>
        <t:dgCol title="手机1" field="cellphone1" width="120"/>
        <t:dgCol title="手机2" field="cellphone2" width="120"/>
        <t:dgCol title="固话" field="telephone" width="120"/>
        <t:dgCol title="传真" field="fax" width="120"/>
        <t:dgCol title="性别" field="gender" width="60" dictionary="<%=StaticValue.DIC_SEX %>"/>
        <t:dgCol title="状态" field="state" width="60" dictionary="<%=StaticValue.DIC_ENGINEER_STATE %>"/>
        <t:dgCol title="email" field="email" width="160"/>
        <t:dgCol title="职位" field="position" width="120" dictionary="<%=StaticValue.DIC_CONTACT_POSITION %>"/>
        <t:dgCol title="来源" field="source" width="120"/>
        <t:dgCol title="联系业务" field="conBusiness" width="150" dictionary="<%=StaticValue.DIC_LINK_BUSINESS %>"/>
        <t:dgCol title="微信级别" field="authenticationlevel" width="120" dictionary="<%=StaticValue.WX_LEVEL %>"/>
    </t:datagrid>
</div>
<div class="subtitle">
    <p>影院设备</p>
</div>
<div class="datagridDiv" style="height: 200px;overflow-x: scroll;">
    <t:datagrid name="zyEquipmentSpareList" fitColumns="false"
                actionUrl="zyEquipmentSpareController.do?datagrid&belongCinemaId=${zyCinemaPage.id }" idField="id"
                fit="true" pagination="false" onLoadSuccess="zyEquipmentSpareListSuccess">
        <t:dgCol title="主键" field="id" hidden="true" queryMode="single" width="120"/>
        <t:dgCol title="设备SN" field="sn" width="120" url="zyEquipmentSpareController.do?goView&id={id}"
                 funname="ZyEquipmentDetials"/>
        <t:dgCol title="机型" field="type.typeDesc" width="120"/>
        <t:dgCol title="厅号" field="house.roomNum" width="40"/>
        <t:dgCol title="BP" field="bpNo" width="120"/>
        <t:dgCol title="省市" field="tsTerritory.territoryName" width="80"/>
        <t:dgCol title="发货日期" field="sendDate" width="120" formatter="yyyy-MM-dd"/>
        <t:dgCol title="安装日期" field="installDate" width="120" formatter="yyyy-MM-dd"/>
        <t:dgCol title="保修期" field="baseRepairDate" width="120" formatter="yyyy-MM-dd"/>
        <t:dgCol title="保修截止日期" field="repairEndDate" width="120" formatter="yyyy-MM-dd"/>
        <t:dgCol title="服务状态" field="serverState" width="120" dictionary="<%=StaticValue.DIC_SERVER_STATE %>"/>
        <t:dgCol title="是否异常" field="isNormal" width="60" dictionary="<%=StaticValue.DIC_TRUE_OR_FALSE_NUM %>"/>
        <t:dgCol title="异常原因" field="exceptionReason" width="100"/>
    </t:datagrid>
</div>
<div class="subtitle">
    <p>服务单历史记录</p>
</div>
<div class="datagridDiv" style="height: 200px;overflow-x: scroll;">
    <t:datagrid name="cbsServiceList" fitColumns="false" actionUrl="cbsServiceController.do?datagrid&belongCinemaId=${zyCinemaPage.id }" idField="id"
                fit="true" pagination="false" onLoadSuccess="zyCbsServiceListSuccess">
        <t:dgCol title="主键" field="id" hidden="true" queryMode="single" width="120"/>
        <t:dgCol title="服务单号" field="code" width="160" url="cbsServiceController.do?detail&id={id}" funname="CbsserviceDetials"/>
        <t:dgCol title="设备SN" field="sn" width="120"/>
        <t:dgCol title="服务类型" field="serviceType2" width="120" dictionary="<%=StaticValue.Source_State %>"/>
        <t:dgCol title="服务状态" field="status" width="120" dictionary="<%=StaticValue.Source_State %>"/>
        <t:dgCol title="服务商" field="serviceProvider" width="80"/>
        <t:dgCol title="服务商处理进度" field="speedstatus" width="120" dictionary="<%=StaticValue.Third_Party_Processing_Progress %>"/>
        <t:dgCol title="创建时间" field="createDate" width="120" formatter="yyyy-MM-dd"/>
        <t:dgCol title="关单时间" field="closeTime" width="120" formatter="yyyy-MM-dd"/>
    </t:datagrid>
</div>
<script type="text/javascript">
    $(function () {
        $("select option:selected").each(function () {
            var text = $(this).val() == "" ? "无" : $(this).text();
            $(this).parent().after('<span>' + text + '</span>').remove();
        });
        $("input").attr({"readonly": "readonly", "disabled": "disabled"}).css("border", "none");
    });
    $(document).ready(function () {
        territoryLinks('cbsServiceList', 'serviceType2', 1);
    });
    function zyContactsListLoadSuccess() {
        reziseDatagridInViewPage("zyContactsList", "datagridDiv", 100);
    }

    function zyEquipmentSpareListSuccess() {
        reziseDatagridInViewPage("zyEquipmentSpareList", "datagridDiv", 100);
    }

    function zyCbsServiceListSuccess() {
        reziseDatagridInViewPage("cbsServiceList", "datagridDiv", 100);
    }

    function ZyEquipmentDetials(filedName,url){
        addOneTab("设备详情",url);
    }

    function CbsserviceDetials(filedName,url){
        var datas = $("#cbsServiceList").datagrid("getSelections");
        var code = datas[0].code;
        addOneTab("服务单详情"+code, url);
    }
</script>
</body>
